package com.wz.boot.dao.weather;

import com.wz.boot.pojo.weather.WeatherSetting;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface WeatherSettingDao {

    @Select("select * from weathersetting")
    List<WeatherSetting> selectAllWeatherSetting();

    @Select("select * from weathersetting where placeName = #{placeName}")
    WeatherSetting selectAllWeatherByPlaceName(@Param("placeName") String placeName);

    @Insert("insert into weathersetting (uid, placename, containplacename, pageurl) values (#{uid},#{placeName},#{containPlaceName},#{pageUrl})")
    Boolean addWeatherSetting(@Param("uid") String uid, @Param("placeName") String placeName, @Param("containPlaceName")String containPlaceName, @Param("pageUrl")String pageUrl);

    @Select("select * from weathersetting where uid = #{uid}")
    WeatherSetting selectWeatherSettingByUid(@Param("uid") String uid);

}
